<div class="layui-fluid nepadmin-pad0 nepadmin-mar0 list0" id="list" lay-title="日志查询">
	<div class="layui-fluid">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md12">
				<div class="layui-card hxr-layui-card" id="userlistv">
					<div class="layui-form layui-card-header hxradmin-card-header">
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">关键词查询</label>
								<div class="layui-input-inline">
									<input type="text" name="user" placeholder="用户名、设备名" class="layui-input" autocomplete="off">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">类型</label>
								<div class="layui-input-inline">
									<div class="layui-unselect layui-form-select">
										<div class="layui-select-title"><input name="status" type="text" placeholder="选择类型" value="" readonly class="layui-input layui-unselect"><i
											 class="layui-edge"></i></div>
										<dl class="layui-anim layui-anim-upbit" style="">
											<dd lay-value="" class="layui-select-tips layui-this">选择类型</dd>
											<dd data='1'>开机</dd>
											<dd data='2'>关机</dd>
											<dd data='3'>其他</dd>
										</dl>
									</div>
								</div>
							</div>
							<div class="layui-inline">
								<button class="layui-btn" data-type="reload" id="search">搜索</button>
							</div>
						</div>
					</div>
					<div class="layui-card-body">
						<table class="layui-hide" id="list-table" lay-filter="list-table"></table>
						<script type="text/html" id="type">
						  {{#  if(d.type === 1){ }}
							开机
						  {{#  } else if(d.type === 2) { }}
						    关机
							{{#  } else if(d.type === 3) { }}
							  其他
						  {{#  } }}
						</script>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
	//表格数据渲染
	layui.use(['table', 'form'], function() {
		var table = layui.table,
			form = layui.form,
			$ = layui.$;
			layui.admin.initlist(table,'device/act_list',240,[
						[{
							field: 'id',
							title: 'ID',
							width: 60
						},{
							field: 'member_name',
							title: '会员名称',
							minWidth: 100
						}, {
							field: 'device_name',
							title: '设备名称',
							minWidth: 200
						}, {
							field: 'remarks',
							title: '备注',
							minWidth: 200
						}, {
							field: 'type',
							title: '类型',
							minWidth: 100,
							templet:'#type'
						}, {
							field: 'create_time',
							title: '创建时间',
							minWidth: 200
						}]
					])

		//搜索
		$('#search').on('click', function() {
			var obj=$(this).parents('.layui-form-item');
			var val1 = obj.find('input[name="user"]').val(),
			val2 = obj.find('input[name="status"]').attr('data');
			layui.admin.reloads({
				search_text:val1,
				type:val2
			});
		});
	});
</script>
